約 5,583,477 件
https://w.atwiki.jp/naobe/pages/78.html
ネットワークに戻る RFC2616概要 HTTP/1.1 RFC6265概要 HTTP状態管理機構 パーセントエンコーディング(URLエンコード) URLで意味を持つコードと混同する日本語などのバイナリや特殊記号を16進形式にして、先頭に%を付加した文字に変換する。正確に言うと、非予約文字、予約文字以外を変換する。 項目 説明 非予約文字 ASCIIのコード範囲内の英字(大文字・小文字)、数字、ハイフン “-”、ピリオド “.”、アンダースコア “_”、チルダ “~” 予約文字 URIを表す符号。ASCIIのコード範囲内のコロン “ ”、スラッシュ “/”、疑問符 “?”、シャープ “#”、角括弧 “[”、“]”、単価記号 “@”、感嘆符 “!”、ドル記号・ペソ記号 “$”、アンパサンド “ ”、アポストロフィー・シングルクオート “ ”、丸括弧 “(”、“)”、アスタリスク “*”、正符号・加算記号 “+”、コンマ “,”、セミコロン “;”、等号 “=” name=%E8%8F%85%E7%9B%B4%E4%BA%BA UTF-8で、%E8%8F%85:菅, %E7%9B%B4 直, %E4%BA%BA 人 x-www-form-urlencoded(URLエンコード) POSTのフォームデータをエンコードする。%を付加する方式は、パーセントエンコーディングと同じ。パーセントエンコーディングの予約文字も変換している スペースは"+"に変換。Javaのソースを見ると、英数字、"-","_", ".","*"以外を変換する BASE64 Wikipediaより データを64種類の印字可能な英数字のみを用いて、それ以外の文字を扱うことの出来ない通信環境にてマルチバイト文字やバイナリデータを扱うためのエンコード方式 7ビットのデータしか扱うことの出来ない電子メールにて広く利用されている A–Z, a–z, 0–9 までの62文字と、記号2つ (+ , /) 、さらにパディング(余った部分を詰める)のための記号として = が用いられる 76文字ごとに改行コードが入る Cookie Wikipediaより クッキーを設定する際、どの要求に対してクッキー情報を送り返すのか、URLの範囲を指定する。 規定値は、クッキーを設定したサーバに対するすべての要求であり、対象を広げることも狭めることもできる。ただし広げる場合でも、トップレベルドメインより狭い範囲でなければならない。 またクッキーの有効期限は、通常はブラウザを終了するまでだが、指定した期限まではブラウザを再度起動しても保持されるように設定することができる。有効期限の情報も、サーバからブラウザにクッキー情報を送信する段階で付加される。 無期限という設定は出来ない。 詳細: http //www.studyinghttp.net/cookies リクエスト 全てテキスト。行(CRLF)で区切られる。 フォーマット リクエストラインは1行。ヘッダは複数行。 大項目 小項目 説明 リクエストライン メソッド GET,POST,PUTなどのどれか。 リクエストURL リクエストを処理するURI プロトコルバージョン HTTPのバージョン。【例】HTTP/1.1 ヘッダ HOST リクエスト先のホスト名。必須項目 空行 POSTのときにヘッダの終了を示すために挿入される メッセージボディ POSTのときにリクエストデータを出力する 【例】 GET http //example.jp/31/31-001.php HTTP/1.1 リクエストライン Host example.jp --+ User-Agent Mozilla/5.0 (Windows NT 5.1; rv 2.0.1) Gecko/20100101 Firefox/4.0.1 | Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +-- ヘッダ Accept-Language ja,en-us;q=0.7,en;q=0.3 | Accept-Encoding gzip, deflate | Accept-Charset Shift_JIS,utf-8;q=0.7,*;q=0.7 | Keep-Alive 115 | Connection keep-alive | Referer http //example.jp/31/ --+ Accept-CharsetでShift-JISの品質係数が1であるため、サーバは、Shift-JISでエンコードしたメッセージを返す。 POST http //example.jp/31/31-003.php HTTP/1.1 リクエストライン Accept image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel ヘッダ Referer http //example.jp/31/31-002.php Accept-Language ja User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Inf oPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Content-Type application/x-www-form-urlencoded Accept-Encoding gzip, deflate Host example.jp Content-Length 65 Connection Keep-Alive Pragma no-cache name=%E8%8F%85%E7%9B%B4%E4%BA%BA mail=kan@aaa.jp gender=%E7%94%B7 メッセージボディ Hostヘッダ HTTP1.1では必須。POST/GETでのURIにHOSTを指定していなかった場合、Virtualホストを特定できない。そのためHostヘッダにHOST名を指定する。URIにホスト名があって、Hostヘッダにもホスト名がある場合はURIを優先する。URIにホスト名を指定することを強制すれば良いような気がするが。 Referer ヘッダの一種。リンク元のURLを示す。あるWebページのリンクをクリックして別のページに移動したときの、リンク元のページのこと。 改変、削除される場合があるので正しくリンクを示しているとは限らない。 セキュリティ上、問題となるのは、URLが秘密情報を含んでいる場合。たとえば、URLがセッションIDを含んでいる場合。なりすましに使われる可能性がある。 【例】 GET http //example.jp/31/31-002.php HTTP/1.1 Accept image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, appl ication/msword, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms -xpsdocument, application/xaml+xml, */* Referer http //example.jp/31/ Accept-Language ja User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Inf oPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Accept-Encoding gzip, deflate Host example.jp Connection Keep-Alive http //example.jp/31/のHTMLのaタグからリクエストが発生したため、Refererヘッダがつく。 レスポンス 全てテキスト。行で区切られる。 フォーマット ステータスラインは1行。ヘッダ、ボディは複数行。 大項目 小項目 説明 ステータスライン プロトコルバージョン ステータスコード 1XX 処理継続、2XX 正常終了、3XX リダイレクト、4XX クライアントエラー、5XX サーバエラー テキストフレーズ レスポンスヘッダ Content-Length ボディのバイト数 Content-Type MIMEタイプ; charset=エンコーディング 空行 ヘッダの終わりを示す ボディ 【例】 HTTP/1.1 200 OK Date Wed, 04 May 2011 04 51 51 GMT Server Apache/2.2.14 (Ubuntu) X-Powered-By PHP/5.3.2-1ubuntu4.2 Vary Accept-Encoding Content-Length 20 Keep-Alive timeout=15, max=100 Connection Keep-Alive Content-Type text/html; charset=UTF-8 body 13 51 /body Content-type メディアタイプを示すエンティティヘッダ(メッセージボディに対する付随情報)。type "/" subtype *( ";" parameter )であらわされる。text/html; charset=utf-8など。charsetを追加すると出力の文字コードを示す。HTML文書にapplication/octet-streamを付けると、 多くの場合、Webブラウザはそれをダウンロードするか否か問い合わせるようになる。 Apacheの場合は、httpd.confの以下の設定でcharsetを指定する。 AddDefaultCharset UTF-8 Tomcatでは、JSPのpageディレクティブで設定する。 %@ page language="java" contentType="text/html; charset=Windows-31J" pageEncoding="Windows-31J" % http //www.atmarkit.co.jp/fjava/rensai3/mojibake01/mojibake01.html 参照
https://w.atwiki.jp/freebsd7/pages/22.html
PHPとは Web開発に特化しており、HTMLに埋め込むことができる 多くの人に利用されているスクリプト言語の一つです。 同じ様なものでCGI、Perl、ASP、Ruby等が挙げられます。 テキストエディタで作成し、サーバにアップすることで直ぐに実行結果が反映され、簡単に編集を行うことができます。 PHPのインストール 設定 プログラミング ↓ ↓ ↓ ↓ ↓ ↓ 以下、広告です。↓ ↓ ↓ ↓ ↓ ↓
https://w.atwiki.jp/amazonz/pages/42.html
?php require_once( Connections/connAmazon2.php ); ? ?php $currentPage = $_SERVER["PHP_SELF"]; $maxRows_rsAmazonz2 = 5; $pageNum_rsAmazonz2 = 0; if (isset($_GET[ pageNum_rsAmazonz2 ])) { $pageNum_rsAmazonz2 = $_GET[ pageNum_rsAmazonz2 ]; } $startRow_rsAmazonz2 = $pageNum_rsAmazonz2 * $maxRows_rsAmazonz2; $colname_rsAmazonz2 = "%"; if (isset($_GET[ key ])) { $colname_rsAmazonz2 = (get_magic_quotes_gpc()) ? $_GET[ key ] addslashes($_GET[ key ]); } mysql_select_db($database_connAmazon2, $connAmazon2); $query_rsAmazonz2 = sprintf("SELECT * FROM amazonz_data WHERE category LIKE %s ORDER BY uptime DESC", $colname_rsAmazonz2); $query_limit_rsAmazonz2 = sprintf("%s LIMIT %d, %d", $query_rsAmazonz2, $startRow_rsAmazonz2, $maxRows_rsAmazonz2); $rsAmazonz2 = mysql_query($query_limit_rsAmazonz2, $connAmazon2) or die(mysql_error()); $row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2); if (isset($_GET[ totalRows_rsAmazonz2 ])) { $totalRows_rsAmazonz2 = $_GET[ totalRows_rsAmazonz2 ]; } else { $all_rsAmazonz2 = mysql_query($query_rsAmazonz2); $totalRows_rsAmazonz2 = mysql_num_rows($all_rsAmazonz2); } $totalPages_rsAmazonz2 = ceil($totalRows_rsAmazonz2/$maxRows_rsAmazonz2)-1; $queryString_rsAmazonz2 = ""; if (!empty($_SERVER[ QUERY_STRING ])) { $params = explode(" ", $_SERVER[ QUERY_STRING ]); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_rsAmazonz2") == false stristr($param, "totalRows_rsAmazonz2") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_rsAmazonz2 = " " . htmlentities(implode(" ", $newParams)); } } $queryString_rsAmazonz2 = sprintf(" totalRows_rsAmazonz2=%d%s", $totalRows_rsAmazonz2, $queryString_rsAmazonz2); ? ?php session_start(); $loginFormAction = $_SERVER[ PHP_SELF ]; if (isset($accesscheck)) { $GLOBALS[ PrevUrl ] = $accesscheck; session_register( PrevUrl ); } if (isset($_POST[ id ])) { $loginUsername=$_POST[ id ]; $password=$_POST[ pass ]; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "admin2.php"; $MM_redirectLoginFailed = "account_cre2.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_connAmazon2, $connAmazon2); $LoginRS__query=sprintf("SELECT id, pass FROM amazonz_user WHERE id= %s AND pass= %s ", get_magic_quotes_gpc() ? $loginUsername addslashes($loginUsername), get_magic_quotes_gpc() ? $password addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $connAmazon2) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $GLOBALS[ MM_Username ] = $loginUsername; $GLOBALS[ MM_UserGroup ] = $loginStrGroup; //register the session variables session_register("MM_Username"); session_register("MM_UserGroup"); if (isset($_SESSION[ PrevUrl ]) false) { $MM_redirectLoginSuccess = $_SESSION[ PrevUrl ]; } header("Location " . $MM_redirectLoginSuccess ); } else { header("Location ". $MM_redirectLoginFailed ); } } ? html head meta http-equiv="Content-Type" content="text/html; charset=euc-jp" title Amazonz -カテゴリ検索- /title link href="css.css" rel="stylesheet" type="text/css" script language="JavaScript" type="text/JavaScript" !-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a i a.length (x=a[i]) x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?")) 0 parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n]) d.all) x=d.all[n]; for (i=0;!x i d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x d.layers i d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i (a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } /script /head body onLoad="MM_preloadImages( img/account2.jpg , img/key2.jpg , img/member2.jpg , img/kate2.jpg )" div id="body_2" div id="head" div id="head1" /div div id="head2" /div /div div id="main" div id="menu" div class="img1" img src="img/menu1.jpg" width="180" height="24" class="img1" /div ?php if($_SESSION[ MM_Username ] == ""){ ? div class="img1" a href="account_cre2.php" class="img1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage( Image6 , , img/account2.jpg ,1)" img src="img/account.jpg" alt="アカウントを作成する" name="Image6" width="180" height="40" hspace="0" vspace="0" border="0" class="img1" /a /div div class="img1" img src="img/menu1.jpg" width="180" height="24" hspace="0" vspace="0" border="0" class="img1" /div div id="login" form name="form1" method="POST" action=" ?php echo $loginFormAction; ? " ユーザーID: input name="id" type="text" size="20" maxlength="22" br パスワード: input name="pass" type="password" id="pass3" size="20" maxlength="20" br p input type="submit" name="Submit" value="ログイン" /p /form /div ?php }else{ ? div id="logout" ?php echo ("ようこそ " .$_SESSION[ MM_Username ]. " さん"); ? br br a href="admin2.php?doLogout=true" ログアウト /a br a href="admin2.php" 管理画面 /a br a href="top.php" home /a /div ?php } ? div class="img1" img src="img/menu1.jpg" width="180" height="24" hspace="0" vspace="0" border="0" class="img1" /div div class="img1" a href="member_s.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage( Image10 , , img/member2.jpg ,1)" img src="img/member.jpg" alt="メンバー検索" name="Image10" width="180" height="40" border="0" /a /div div class="img1" a href="category_s.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage( Image11 , , img/kate2.jpg ,1)" img src="img/kate.jpg" alt="カテゴリー検索" name="Image11" width="180" height="40" border="0" /a /div div class="img1" a href="key_s.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage( Image9 , , img/key2.jpg ,1)" img src="img/key.jpg" alt="キーワード検索" name="Image9" width="180" height="40" border="0" /a /div /div ?php if($kensu = 2){ ? div id="text" ?php }else if($kensu = 1){ ? div id="text2" ?php } ? img src="img/blank.jpg" form name="form1" method="get" action="" br div align="center" カテゴリ検索 select name="key" id="key" option value="" selected /option option value="DVD" DVD /option option value="MUSIC" MUSIC /option option value="BOOK" BOOK /option /select input type="submit" name="Submit" value="検索" /div /form p align="center" !-- セレクトKEYがからでない場合以後表示 -- ?php if($_GET[ key ] !=""){ $key=$_GET[ key ]; $kensu=$totalRows_rsAmazonz2; print(" $key で検索した結果"); print(" $kensu 件ヒットしました"); ? 投稿 ?php echo ($startRow_rsAmazonz2 + 1) ? ~ ?php echo min($startRow_rsAmazonz2 + $maxRows_rsAmazonz2, $totalRows_rsAmazonz2) ? 件 / 全 ?php echo $totalRows_rsAmazonz2 ? ?php }? /p table width="400" border="0" align="center" cellpadding="3" class="style3" ?php do { ? tr td ?php echo $row_rsAmazonz2[ uptime ]; ? /td /tr tr td ?php echo $row_rsAmazonz2[ title ]; ? /td /tr tr td ?php echo $row_rsAmazonz2[ category ]; ? /td /tr tr td ?php echo nl2br($row_rsAmazonz2[ topic ]); ? /td /tr tr td ?php echo $row_rsAmazonz2[ uset_id ]; ? /td /tr tr td hr /td /tr ?php } while ($row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2)); ? /table table border="0" width="50%" align="center" tr td width="23%" align="center" ?php if ($pageNum_rsAmazonz2 0) { // Show if not first page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, 0, $queryString_rsAmazonz2); ? " 先頭 /a ?php } // Show if not first page ? /td td width="31%" align="center" ?php if ($pageNum_rsAmazonz2 0) { // Show if not first page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, max(0, $pageNum_rsAmazonz2 - 1), $queryString_rsAmazonz2); ? " 戻る /a ?php } // Show if not first page ? /td td width="23%" align="center" ?php if ($pageNum_rsAmazonz2 $totalPages_rsAmazonz2) { // Show if not last page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, min($totalPages_rsAmazonz2, $pageNum_rsAmazonz2 + 1), $queryString_rsAmazonz2); ? " 次へ /a ?php } // Show if not last page ? /td td width="23%" align="center" ?php if ($pageNum_rsAmazonz2 $totalPages_rsAmazonz2) { // Show if not last page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, $totalPages_rsAmazonz2, $queryString_rsAmazonz2); ? " 最終 /a ?php } // Show if not last page ? /td /tr /table ?php mysql_free_result($rsAmazonz2); ? p nbsp; /p /div div id="under" div id="under1" /div div id="under2" /div /div /div /div /body /html
https://w.atwiki.jp/drupal/pages/71.html
Kabuki Projectメイン kabuki.info ; $Id kabuki.info,v 1.13.2.1 2009/02/13 06 13 18 johnalbin Exp $ ; The name and description of the theme used on the admin/build/themes page.name = Kabukidescription = Kabuki and Japanese traditional colors. ; The screenshot used on the admin/build/themes page.screenshot = screenshot.png ; "core" specifies the version of Drupal that this theme is compatible with. ; "base theme" specifies that this is a theme that uses the "zen" theme as its ; base theme. Its unlikely you will ever need to change these, but they are ; required fields for a Zen sub-theme. The "engine" field is not used in a ; sub-theme since the engine is inherited from its base theme.core = 6.xbase theme = zen ; This section adds CSS files to your theme. The media type is specified in ; the brackets. Typical CSS media types include "all", "screen", "print", and ; "handheld". See http //www.w3.org/TR/CSS21/media.html#media-types for a full ; list of stylesheet media types in CSS 2.1. ; ; You can also override any of Zen s stylesheets or any module s stylesheets, ; an /extremely/ useful feature. See the excellent Drupal 6 Theme Guide at ; http //drupal.org/node/171209 for more details.stylesheets[all][] = layout.cssstylesheets[all][] = html-elements.css; stylesheets[all][] = tabs.css; stylesheets[all][] = messages.css; stylesheets[all][] = block-editing.css; stylesheets[all][] = wireframes.cssstylesheets[all][] = kabuki.cssstylesheets[print][] = print.css ; To prevent stylesheets of a base theme or of a module from being included in ; our sub-theme, we specify it in our .info file (and we don t need to have a ; stylesheet in our sub-theme with that name.) For example, we prevent the ; zen.css file in the base theme from being included by specifying it here.stylesheets[all][] = zen.css ; Set the conditional stylesheets that are processed by IE.; conditional-stylesheets[if IE][all][] = ie.css ; Optionally add some jquery scripts to your theme.; scripts[] = script.js ; The regions defined in Zen s default page.tpl.php file. The name in ; brackets is the name of the variable in the page.tpl.php file, (e.g. ; "[content_top]" in the .info file means there should be a $content_top ; variable in the page.tpl.php file.) The text after the equals sign is a ; descriptive text used on the admin/build/blocks page. ; ; To add a new region, copy Zen s page.tpl.php to your sub-theme s directory, ; add a line line to this file, and then add the new variable to your ; page.tpl.php template.regions[left] = left sidebarregions[right] = right sidebarregions[navbar] = navigation barregions[content_top] = content topregions[content_bottom] = content bottomregions[header] = headerregions[footer] = footerregions[closure_region] = closure ; Various page elements output by the theme can be toggled on and off. The ; "features" control which of these check boxes display on the ; admin/build/themes config page. This is useful for suppressing check boxes ; for elements not used by your sub-theme. To suppress a check box, omit the ; entry for it below. See the Drupal 6 Theme Guide for more info ; http //drupal.org/node/171205#featuresfeatures[] = logofeatures[] = namefeatures[] = sloganfeatures[] = missionfeatures[] = node_user_picturefeatures[] = comment_user_picturefeatures[] = searchfeatures[] = faviconfeatures[] = primary_linksfeatures[] = secondary_links ; Set the default settings to be used in theme-settings.phpsettings[zen_block_editing] = 1settings[zen_breadcrumb] = yessettings[zen_breadcrumb_separator] = settings[zen_breadcrumb_home] = 1settings[zen_breadcrumb_trailing] = 1settings[zen_breadcrumb_title] = 0settings[zen_rebuild_registry] = 1settings[zen_wireframes] = 1 ; Information added by drupal.org packaging script on 2009-02-13version = "6.x-1.0"core = "6.x"project = "zen"datestamp = "1234555897" コメント settings[zen_wireframes] = 1 にしますた - 2009-06-13 00 43 29
https://w.atwiki.jp/even_eko/pages/15.html
MacPortsインストール 更新日 2012-11-13 http //www.macports.org/install.php 上のサイトから、pkgファイルをダウンロードすればok PEARアップグレード 更新日 2012-11-13 東工大のネットからpearをupgradeしようとしたら、以下のエラーが出てできなかった。 Could not get contents of package "/Applications/MAMP/bin/php/php5.3.6/bin/pear". Invalid tgz file. sudoをはずすと途中まではできるようになった。ただし、権限がないためにこんなエラーが出る。 ERROR failed to mkdir /Applications/MAMP/bin/php/php5.3.6/lib/php/docs/PEAR 強引ではあるが、Finderから上のディレクトリを作成する。 imageプラグインエラー ご指定のURLはサポートしていません。png, jpg, gif などの画像URLを指定してください。 次に、sudoをしないでpearをアップグレードさせる。 ./pear upgrade pear PHPUnitインストール 更新日 2012-11-13 MAMPのバージョン2.0.5 cd /Applications/MAMP/bin/php/php5.3.6/bin sudo ./pear upgrade pear ./pear channel-discover pear.phpunit.de ./pear channel-discover components.ez.no ./pear channel-discover pear.symfony-project.com sudo ./pear install phpunit/PHPUnit こんなエラーが出たら、 Notice unserialize() Error at offset 276 of 1133 bytes in Config.php on line 1050 Notice unserialize() Error at offset 276 of 1133 bytes in /Applications/MAMP/bin/php/php5.3.6/lib/php/PEAR/Config.php on line 1050 ERROR The default config file is not a valid config file or is corrupted. 以下のコマンドを入力して、pear.confを削除する。 rm /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf 参考サイト http //d.hatena.ne.jp/nkimra/20120715/1342312360 phpでデーモンを走らせる pearをインストールする。 yum -y install php-pear System_Daemonをインストールする。 pear install System_Daemon System_Daemonを実行するためには、posixがインストールされている必要がある。 しかし、php5.3.0以降posixが非推奨になっているので、手動でインストールしなければならない。 理由は、バイナリセーフでないから。詳しくは参考URLに載ってる。 posixをインストールするには、 pear install posix デーモンのループ中にechoやターミナルに直接ログを吐かせたりすると、fatal_errorになってしまう。 ターミナルをそのまま閉じないのなら問題はない。ただし、デーモンである意味もない。 ターミナルを閉じると、吐き出す先がなくなってしまうためエラーになってしまう。 参考サイト http //d.hatena.ne.jp/t_komura/20090526/1243349783
https://w.atwiki.jp/mekagazira/pages/24.html
PHP PHP インストール トラブル トラブル リンク先やボタンのURLのホスト部分がおかしい! 参考URL インストール 最新のphpのソースを取得する http //www.php.net/downloads.php $ pwd /export/meka/20100903php/php-5.2.14 $wget http //jp2.php.net/get/php-5.2.14.tar.gz/from/jp.php.net/mirror インストール $gunzip php-5.2.14.tar.gz $tar xvf php-5.2.14.tar $LD_LIBRARY_PATH= /usr/local/lib $PATH=/usr/local/bin /usr/bin /usr/sfw/bin /usr/ccs/bin $export LD_LIBRARY_PATH $export PATH $cd php-5.2.14 $./configure --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs #LD_LIBRARY_PATH= /usr/local/lib #PATH=/usr/local/bin /usr/bin /usr/sfw/bin /usr/ccs/bin #export LD_LIBRARY_PATH #export PATH #make install # cp -pi php.ini-dist /usr/local/lib/php/php.ini apacheの設定 /usr/local/apache2/conf/httpd.confへ以下の記述を追加する。 310 #2010/09/03追加 311 AddType application/x-httpd-php .php $apachectl configtest Syntax OK /usr/local/apache2/htdocsへ test.phpを作成しテスト $vi test.php ? phpinfo()? ブラウザからアクセスして確認する。 http //192.168.11.4/test.php トラブル 初めrootになったあと、そのままmake installを実行したら以下のエラーが発生した。 Undefined first referenced symbol in file libiconv_close ext/iconv/.libs/iconv.o libiconv_open ext/iconv/.libs/iconv.o libiconv ext/iconv/.libs/iconv.o ld fatal Symbol referencing errors. No output written to sapi/cli/php collect2 ld returned 1 exit status make *** [sapi/cli/php] Error 1 LD_LIBRARY_PATHとPATHの設定をして再度make installしたら成功した。 chmod 755 /usr/local/apache2/modules/libphp5.so [activating module `php5 in /usr/local/apache2/conf/httpd.conf] Installing PHP CLI binary /usr/local/bin/ Installing PHP CLI man page /usr/local/man/man1/ Installing build environment /usr/local/lib/php/build/ Installing header files /usr/local/include/php/ Installing helper programs /usr/local/bin/ program phpize program php-config Installing man pages /usr/local/man/man1/ page phpize.1 page php-config.1 Installing PEAR environment /usr/local/lib/php/ [PEAR] Archive_Tar - installed 1.3.7 [PEAR] Console_Getopt - installed 1.2.3 [PEAR] Structures_Graph- installed 1.0.3 [PEAR] XML_Util - installed 1.2.1 [PEAR] PEAR - installed 1.9.1 Wrote PEAR system config file at /usr/local/etc/pear.conf You may want to add /usr/local/lib/php to your php.ini include_path Installing PDO headers /usr/local/include/php/ext/pdo/ 以下の通りgccでインストールしたから成功したのかな?? # which gcc /usr/local/bin/gcc トラブル リンク先やボタンのURLのホスト部分がおかしい! httpd.confのServerNameを変更すると。。。なおりました。 99 #ServerName www.mekagazi.com 80 100 ServerName 192.168.11.4 80 http //www.mekagazi.com/pukiwiki/index.php?FrontPage http //192.168.11.4/pukiwiki/index.php?FrontPage 参考URL http //www.harunire.com/t-yoda/index.php?Solaris/PukiWiki
https://w.atwiki.jp/sq4fqq/pages/11.html
php練習1 dreamweverサイト管理→新規作成→サイト htmlファイルで p 名前を入力してください。 /p form action="test.php" method="post" input name="namae" type="text" size="20" maxlength="20" / input name="submit" type="submit" value="送信" / /form 新規→ダイナミックページ→phpphpファイルで こんにちは、 ?php echo $_POST["name"];? さん →こんにちは○○さんと出力される ?php /* 複数行のコメント 複数行のコメント 複数行のコメント / $school ="デジハリ"; echo "私は、$school に通っています br / "; echo "私は、{$school}に通っています br / "; echo 私は、{$school}に通っています br / \n ; echo "私は、".$school."に通っています br / \n"; echo "私は、 font color=\"red\" $school /font に通っています br / \n"; echo "私は、 font color= red $school /font に通っています br / \n"; ? →私はデジハリ に通っています。 →私はデジハリに通っています。 →私は、{$school}に通っています \n →\n私は、デジハリに通っています →私は、デジハリに通っています →私は、デジハリに通っています @がエラーでていると全角使用 Apachdocumentroot○○○で公開される場所を変更できる。 php.iniの設定httpd.conf、php.iniが編集できない共有サーバのユーザは、 .htaccessを利用する。 設定例 php.ini mbstring.language="japanese" ↓ .htaccess php_value mbstring.language"japanese" $year_start= 1930; $year_end= 2007; for($y=$year_start; $y =$year_end; $y++){ $year_list[] =$y; } form action="birthday4.php" method="post" select name="year" ?php foreach ($year_list as $value){ echo " option value=\"$value\" $value /option \n"; } ? /select コーディング規約 if($k 10){ $a=$k; } タブは使わない。
https://w.atwiki.jp/redcloud/pages/19.html
目次 目次 前提条件 PHP5.3.0 インストール libxml2-develをインストール curl-develをインストール mysqlクライアントをインストール gdをインストール ※画像処理 PHPインストール 設定 php.iniの編集 httpd.confの編集 動作確認 xdebugインストール(デバッグ用) 前提条件 CentOS5.4上に構築する PHP5.3.0 インストール libxml2-develをインストール # yum -y install libxml2-devel curl-develをインストール # yum -y install curl-devel mysqlクライアントをインストール ncurses-develのインストール # yum -y install ncurses-devel mysql-tritonnのインストール ※MySQLクライアント。MySQLサーバが全文検索対応(tritonn)であることを前提とする $ wget http //osdn.dl.sourceforge.jp/tritonn/36449/tritonn-1.0.12-mysql-5.0.67.tar.gz $ tar zxvf tritonn-1.0.12-mysql-5.0.67.tar.gz $ cd tritonn-1.0.12-mysql-5.0.67 $ ./configure --prefix=/usr/local --with-readline --without-server $ make $ sudo make install gdをインストール ※画像処理 libjpegなどのヘッダファイルが必要そうなので先にyumでインストール # yum install -y libjpeg-devel # yum install -y libpng-devel # yum install -y freetype-devel # yum install -y fontconfig-devel # yum install -y libXpm-devel # yum install -y gettext-devel インストール $ wget http //www.libgd.org/releases/gd-2.0.35.tar.gz $ tar zxvf gd-2.0.35.tar.gz $ cd gd-2.0.35 $ ./configure --prefix=/usr/local --enable-shared $ make $ sudo make install PHPインストール $ wget http //jp.php.net/get/php-5.3.0.tar.gz/from/this/mirror $ tar zxvf php-5.3.0.tar.gz $ cd php-5.3.0 $ ./configure --prefix=/usr/local --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring=shared --with-mysql=shared,/usr/local --enable-pdo=shared --with-pdo-mysql=shared,/usr/local --without-sqlite --without-pdo-sqlite --with-xmlrpc --with-gd=shared,/usr/local --enable-gd-jis-conv --with-zlib-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-curl $ make $ make test $ sudo make install 設定 php.iniの編集 $ sudo cp -p php.ini-development /usr/local/lib/php.ini # chown root.root /usr/local/lib/php.ini # vi /usr/local/lib/php.ini ;extension_dir = "./" extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626/" extension=gd.so extension=mbstring.so extension=mysql.so extension=pdo.so extension=pdo_mysql.so httpd.confの編集 # vi /usr/local/apache2/conf/httpd.conf 動作確認 $ vi ~/htdocs/phpinfo.php ?php phpinfo(); # service httpd start phpinfoが正常表示される事を確認 ★dateセクションでwarningが表示されてるのが気になる。。。 xdebugインストール(デバッグ用) $ wget http //xdebug.org/files/xdebug-2.0.5.tgz $ tar zxvf xdebug-2.0.5.tgz $ cd xdebug-2.0.5 $ phpize $ ./configure --with-php-config=/usr/local/bin/php-config --enable-xdebug $ make $ sudo cp -p modules/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ $ sudo vi /usr/local/lib/php.ini zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so $ ~/htdocs/debug.php ?php $hoge = あいうえお ; var_dump($hoge); phpinfoでxdebugセクションが表示され、var_dumpがデバッグレイアウトで表示される事を確認
https://w.atwiki.jp/01128/pages/28.html
date 2012/1/29 PHPを導入する! 現在、PHPはVer5みたい。つまりphp5ってことかな? $ sudo apt-get install php5 おお。正解。apt-getで指定する名前はどこで公開されるんだろうね? MySQLとの連携 当然だけど連携させなきゃ。 $ sudo apt-get install php5-mysql なんか本当か?というくらい簡単。キーワード知ってればいいだけじゃん。。 動作確認 PHP動作確認用ページを作成後、 /var/www/info.php リブートして $ sudo /etc/init.d/apache2 restart でけたー!MySQLとの連携もうまくいっているみたい。 参考URL http //ja.wikipedia.org/wiki/PHP _Hypertext_Preprocessor http //debianj.com/ubuntu/install/lamp_lapp.html
https://w.atwiki.jp/amazonz/pages/20.html
アップロード・ダウンロード ?php session_start(); $logoutAction = $_SERVER[ PHP_SELF ]."?doLogout=true"; if (*1) ($_SERVER[ QUERY_STRING ] != "")){ $logoutAction .=" ". htmlentities($_SERVER[ QUERY_STRING ]); } if (*2) ($_GET[ doLogout ]=="true")){ //to fully log out a visitor we need to clear the session varialbles session_unregister( MM_Username ); session_unregister( MM_UserGroup ); $logoutGoTo = "view.php"; if ($logoutGoTo) { header("Location $logoutGoTo"); exit; } } ? ?php require_once( Connections/connAmazon2.php ); ? ?php session_start(); $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") true) { $isValid = true; } } return $isValid; } $MM_restrictGoTo = "login.php"; if (!(*3) (isAuthorized("",$MM_authorizedUsers, $_SESSION[ MM_Username ], $_SESSION[ MM_UserGroup ])))) { $MM_qsChar = "?"; $MM_referrer = $_SERVER[ PHP_SELF ]; if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = " "; if (isset($QUERY_STRING) strlen($QUERY_STRING) 0) $MM_referrer .= "?" . $QUERY_STRING; $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location ". $MM_restrictGoTo); exit; } ? ?php $currentPage = $_SERVER["PHP_SELF"]; function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) $theValue; switch ($theType) { case "text" $theValue = ($theValue != "") ? " " . $theValue . " " "NULL"; break; case "long" case "int" $theValue = ($theValue != "") ? intval($theValue) "NULL"; break; case "double" $theValue = ($theValue != "") ? " " . doubleval($theValue) . " " "NULL"; break; case "date" $theValue = ($theValue != "") ? " " . $theValue . " " "NULL"; break; case "defined" $theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER[ PHP_SELF ]; if (isset($_SERVER[ QUERY_STRING ])) { $editFormAction .= "?" . htmlentities($_SERVER[ QUERY_STRING ]); } if (*4) ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO amazonz_data (id, title, category, topic, uptime, uset_id) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST[ id ], "int"), GetSQLValueString($_POST[ title ], "text"), GetSQLValueString($_POST[ category ], "text"), GetSQLValueString($_POST[ topic ], "text"), GetSQLValueString($_POST[ uptime ], "date"), GetSQLValueString($_POST[ uset_id ], "text")); mysql_select_db($database_connAmazon2, $connAmazon2); $Result1 = mysql_query($insertSQL, $connAmazon2) or die(mysql_error()); $insertGoTo = "admin.php"; if (isset($_SERVER[ QUERY_STRING ])) { $insertGoTo .= (strpos($insertGoTo, ? )) ? " " "?"; $insertGoTo .= $_SERVER[ QUERY_STRING ]; } header(sprintf("Location %s", $insertGoTo)); } $maxRows_rsAmazonz2 = 10; $pageNum_rsAmazonz2 = 0; if (isset($_GET[ pageNum_rsAmazonz2 ])) { $pageNum_rsAmazonz2 = $_GET[ pageNum_rsAmazonz2 ]; } $startRow_rsAmazonz2 = $pageNum_rsAmazonz2 * $maxRows_rsAmazonz2; $colname_rsAmazonz2 = "%"; if (isset($_GET[ key ])) { $colname_rsAmazonz2 = (get_magic_quotes_gpc()) ? $_GET[ key ] addslashes($_GET[ key ]); } mysql_select_db($database_connAmazon2, $connAmazon2); $sessionname=$_SESSION[ MM_Username ]; $query_rsAmazonz2 = sprintf("SELECT * FROM amazonz_data WHERE topic LIKE %s uset_id = $sessionname ORDER BY uptime DESC" , $colname_rsAmazonz2); $query_limit_rsAmazonz2 = sprintf("%s LIMIT %d, %d", $query_rsAmazonz2, $startRow_rsAmazonz2, $maxRows_rsAmazonz2); $rsAmazonz2 = mysql_query($query_limit_rsAmazonz2, $connAmazon2) or die(mysql_error()); $row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2); if (isset($_GET[ totalRows_rsAmazonz2 ])) { $totalRows_rsAmazonz2 = $_GET[ totalRows_rsAmazonz2 ]; } else { $all_rsAmazonz2 = mysql_query($query_rsAmazonz2); $totalRows_rsAmazonz2 = mysql_num_rows($all_rsAmazonz2); } $totalPages_rsAmazonz2 = ceil($totalRows_rsAmazonz2/$maxRows_rsAmazonz2)-1; $queryString_rsAmazonz2 = ""; if (!empty($_SERVER[ QUERY_STRING ])) { $params = explode(" ", $_SERVER[ QUERY_STRING ]); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_rsAmazonz2") == false stristr($param, "totalRows_rsAmazonz2") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_rsAmazonz2 = " " . htmlentities(implode(" ", $newParams)); } } $queryString_rsAmazonz2 = sprintf(" totalRows_rsAmazonz2=%d%s", $totalRows_rsAmazonz2, $queryString_rsAmazonz2); ? !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http //www.w3.org/TR/html4/loose.dtd" html head meta http-equiv="Content-Type" content="text/html; charset=euc-jp" title ログ管理 /title style type="text/css" !-- .style6 {font-size 10px} /style /head body form name="form1" method="get" action="" div align="center" ?php echo ($_SESSION[ MM_Username ]. "さん こんにちわ!"); ? input name="key" type="text" id="key" input name="Submit" type="submit" value="検索" a href="add.php" 投稿 /a a href=" ?php echo $logoutAction ? " ログアウト /a a href="view.php" 投稿閲覧 /a /div /form br form method="post" name="form2" action=" ?php echo $editFormAction; ? " table width="250" height="100" align="center" tr valign="baseline" td align="left" nowrap class="style6" タイトル: input type="text" name="title" value="" size="32" /td /tr tr valign="baseline" td align="left" nowrap span class="style6" カテゴリ: select name="category" option value="BOOK" ?php if (!(strcmp("BOOK", ""))) {echo "SELECTED";} ? BOOK /option option value="DVD" ?php if (!(strcmp("DVD", ""))) {echo "SELECTED";} ? DVD /option option value="CD" ?php if (!(strcmp("CD", ""))) {echo "SELECTED";} ? CD /option /select /span /td /tr tr valign="baseline" td align="left" valign="top" nowrap p class="style6" トピック: br textarea name="topic" cols="40" rows="5" /textarea /p /td /tr tr valign="baseline" td align="left" nowrap input type="submit" value="投稿" /td /tr /table input type="hidden" name="id" value="" input type="hidden" name="uptime" value=" ?php echo date( Y/m/d H i s ); ? " input type="hidden" name="uset_id" value=" ?php echo($_SESSION[ MM_Username ]); ? " input type="hidden" name="MM_insert" value="form2" /form p nbsp; /p table width="400" border="0" align="center" cellpadding="3" ?php do { ? tr td span class="style6" ?php echo $row_rsAmazonz2[ uptime ]; ? /span /td /tr tr td span class="style6" ?php echo $row_rsAmazonz2[ title ]; ? /span /td /tr tr td span class="style6" ?php echo $row_rsAmazonz2[ category ]; ? /span /td /tr tr td span class="style6" ?php echo $row_rsAmazonz2[ topic ]; ? /span /td /tr tr td span class="style6" ?php echo $row_rsAmazonz2[ uset_id ]; ? /span /td /tr tr td span class="style6" a href="update.php?id= ?php echo $row_rsAmazonz2[ id ]; ? " 修正 /a a href="del.php?id= ?php echo $row_rsAmazonz2[ id ]; ? " 削除 /a /span hr /td /tr ?php } while ($row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2)); ? /table table border="0" width="50%" align="center" tr td width="23%" align="center" ?php if ($pageNum_rsAmazonz2 0) { // Show if not first page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, 0, $queryString_rsAmazonz2); ? " 先頭 /a ?php } // Show if not first page ? /td td width="31%" align="center" ?php if ($pageNum_rsAmazonz2 0) { // Show if not first page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, max(0, $pageNum_rsAmazonz2 - 1), $queryString_rsAmazonz2); ? " 戻る /a ?php } // Show if not first page ? /td td width="23%" align="center" ?php if ($pageNum_rsAmazonz2 $totalPages_rsAmazonz2) { // Show if not last page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, min($totalPages_rsAmazonz2, $pageNum_rsAmazonz2 + 1), $queryString_rsAmazonz2); ? " 次へ /a ?php } // Show if not last page ? /td td width="23%" align="center" ?php if ($pageNum_rsAmazonz2 $totalPages_rsAmazonz2) { // Show if not last page ? a href=" ?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, $totalPages_rsAmazonz2, $queryString_rsAmazonz2); ? " 最終 /a ?php } // Show if not last page ? /td /tr /table /body /html ?php mysql_free_result($rsAmazonz2); ?